namespace ModelFirst.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class iiii46 : DbMigration
    {
        public override void Up()
        {
            DropForeignKey("dbo.Articles", "AuthorId", "dbo.Authors");
            AddColumn("dbo.Articles", "Author_Id", c => c.Int());
            AddColumn("dbo.Articles", "Author_Id1", c => c.Int());
            AddColumn("dbo.Blogs", "Update_Id", c => c.Int());
            CreateIndex("dbo.Articles", "Author_Id");
            CreateIndex("dbo.Articles", "Author_Id1");
            CreateIndex("dbo.Blogs", "Update_Id");
            AddForeignKey("dbo.Blogs", "Update_Id", "dbo.Authors", "Id");
            AddForeignKey("dbo.Articles", "Author_Id1", "dbo.Authors", "Id");
            AddForeignKey("dbo.Articles", "Author_Id", "dbo.Authors", "Id");
        }
        
        public override void Down()
        {
            DropForeignKey("dbo.Articles", "Author_Id", "dbo.Authors");
            DropForeignKey("dbo.Articles", "Author_Id1", "dbo.Authors");
            DropForeignKey("dbo.Blogs", "Update_Id", "dbo.Authors");
            DropIndex("dbo.Blogs", new[] { "Update_Id" });
            DropIndex("dbo.Articles", new[] { "Author_Id1" });
            DropIndex("dbo.Articles", new[] { "Author_Id" });
            DropColumn("dbo.Blogs", "Update_Id");
            DropColumn("dbo.Articles", "Author_Id1");
            DropColumn("dbo.Articles", "Author_Id");
            AddForeignKey("dbo.Articles", "AuthorId", "dbo.Authors", "Id", cascadeDelete: true);
        }
    }
}
